<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html,
        body {
            width: 100%;
            height: 100%;
        }

        ul {
            width: 500px;
            height: 300px;

            list-style: none;
            margin: auto;
        }

        li {
            float: left;
            margin: 10px 10px;
            border: 1px solid black;
        }

        img {
            width: 100px;
            height: 100px;
            opacity: 0.3;
            filter: alpha(opacity=30);
            cursor: pointer;
        }

        li.current img {
            opacity: 1;
            filter: alpha(opacity=100);
        }
    </style>
</head>

<body>
    <ul>
        <li><img src="./1.jpg" alt=""></li>
        <li><img src="./1.jpg" alt=""></li>
        <li><img src="./1.jpg" alt=""></li>
        <li><img src="./1.jpg" alt=""></li>
        <li><img src="./1.jpg" alt=""></li>
        <li><img src="./1.jpg" alt=""></li>
        <li><img src="./1.jpg" alt=""></li>
        <li><img src="./1.jpg" alt=""></li>
    </ul>
</body>
<script>
    var oli = document.getElementsByTagName('li')

    for (var i = 0; i < oli.length; i++) {
        oli[i].onmouseenter = function () {
            this.className = "current"
        }
        oli[i].onmouseleave = function () {
            this.className = ''
        }
    }
</script>

</html>